<?php if ($this->Membership_model->is_owner($bricabox->id)): ?>
<div class="block_header">
	<div id="block_prefs_<?php echo $inst->id; ?>" style="display: none;">
		<form action="/bricabox/<?php echo $bricabox->id; ?>/save_block_prefs" method="post">
			<input type="hidden" name="id" value="<?php echo $inst->id; ?>" />
			<?php if ($content !== false): ?>
				<input type="hidden" name="content_id" value="<?php echo $content->id; ?>" />
			<?php endif; ?>
			<input type="hidden" name="block_name" value="rss" />
			<input type="hidden" name="name" value="feed_url" />
			<input type="hidden" name="return_to" value="/<?php echo $this->uri->uri_string(); ?>" />
			<fieldset>
				<div>
					<label for="feed_url_<?php echo $inst->id; ?>">Paste the feed URL below:</label><br />
					<input name="value" id="feed_url_<?php echo $inst->id; ?>"
					value="<?php if ($feed_url) echo $feed_url; ?>" size="30" />
				</div>
				
				<div class="controls">
					<input type="submit" value="Save" />
					or <a href="#" onclick="return PrefPane.toggle(<?php echo $inst->id; ?>);">cancel</a>
				</div>
			</fieldset>
		</form>
	</div>
</div>
<?php endif; ?>

<?php if ($feed): ?>

<div id="feed_<?php echo $inst->id; ?>" class="feed">
	<?php if ($feed->error()): ?>
	<p><?php echo htmlspecialchars($feed->error()); ?></p>
	<?php endif; ?>
	
	<ul>
	<?php foreach ($feed->get_items() as $item): ?>
		<li><?php if ($item->get_permalink()) echo '<a href="' . $item->get_permalink() . '">'; echo $item->get_title(); if ($item->get_permalink()) echo '</a>'; ?></li>
	<?php endforeach; ?>
	</ul>
</div>

<?php endif; ?>